/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dp.vo;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author wyr
 */
@Entity
@Table(name = "news_question")
//@NamedQueries({@NamedQuery(name = "NewsQuestion.findAll", query = "SELECT n FROM NewsQuestion n"), @NamedQuery(name = "NewsQuestion.findByQuestionid", query = "SELECT n FROM NewsQuestion n WHERE n.questionid = :questionid"), @NamedQuery(name = "NewsQuestion.findByQuestname", query = "SELECT n FROM NewsQuestion n WHERE n.questname = :questname")})
public class NewsQuestion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "questionid")
    private Integer questionid;
    @Column(name = "questname")
    private String questname;
    @Column(name = "questorder")
    private Integer questorder;
    @Column(name = "questisok")
    private Integer questisok;
    @Column(name = "answermutiselect")
    private Integer answermutiselect;
    //@OneToMany(cascade = CascadeType.ALL, mappedBy = "newsQuestion")
    @OneToMany(fetch = FetchType.EAGER, mappedBy = "newsQuestion")
    private Set<NewsQuestionAnswer> newsQuestionAnswerSet;
    @JoinColumn(name = "channleid", referencedColumnName = "channleid")
    @ManyToOne
    private NewsExtendsChannel channleid;

    public NewsQuestion() {
    }

    public NewsQuestion(Integer questionid) {
        this.questionid = questionid;
    }

    public Integer getQuestionid() {
        return questionid;
    }

    public void setQuestionid(Integer questionid) {
        this.questionid = questionid;
    }

    public String getQuestname() {
        return questname;
    }

    public void setQuestname(String questname) {
        this.questname = questname;
    }

    public Set<NewsQuestionAnswer> getNewsQuestionAnswerSet() {
        return newsQuestionAnswerSet;
    }

    public void setNewsQuestionAnswerSet(Set<NewsQuestionAnswer> newsQuestionAnswerSet) {
        this.newsQuestionAnswerSet = newsQuestionAnswerSet;
    }

    public NewsExtendsChannel getChannleid() {
        return channleid;
    }

    public void setChannleid(NewsExtendsChannel channleid) {
        this.channleid = channleid;
    }
    
    public Integer getQuestorder() {
		return questorder;
	}

	public void setQuestorder(Integer questorder) {
		this.questorder = questorder;
	}

	public Integer getQuestisok() {
		return questisok;
	}

	public void setQuestisok(Integer questisok) {
		this.questisok = questisok;
	}

	public Integer getAnswermutiselect() {
		return answermutiselect;
	}

	public void setAnswermutiselect(Integer answermutiselect) {
		this.answermutiselect = answermutiselect;
	}

	@Override
    public int hashCode() {
        int hash = 0;
        hash += (questionid != null ? questionid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof NewsQuestion)) {
            return false;
        }
        NewsQuestion other = (NewsQuestion) object;
        if ((this.questionid == null && other.questionid != null) || (this.questionid != null && !this.questionid.equals(other.questionid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dp.vo.NewsQuestion[questionid=" + questionid + "]";
    }

}
